package arbitration.gui;



import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

/**
 * Main panel
 * @author Startsev S.S.
 * @version 1.0
 * @see JPanel
 */
public class MainPanel extends JPanel {    
    /**
     * constructor
     * @param parent owner     
     */
    MainPanel(JFrame parent, StatusPanel status) {
        setLayout(new GridBagLayout());
        InformationPanel infoPanel = new InformationPanel();


        JMenuBar mbar = new JMenuBar();
        parent.setJMenuBar(mbar);

        JMenu file = new JMenu("Файл");
        file.setFont(new Font("Tahoma", Font.TRUETYPE_FONT, 11));
        file.setMnemonic('F');
        JMenuItem start,next,exit;

        start = new JMenuItem("Run");
        start.setName("Run");
        start.setMnemonic('R');
        start.setAccelerator(KeyStroke.getKeyStroke("F5"));
        //start.addActionListener(tablePanel);
        //file.add(start);

        next = new JMenuItem("Next");
        next.setName("Next");
        next.setMnemonic('N');
        next.setAccelerator(KeyStroke.getKeyStroke("F7"));
        //next.addActionListener(tablePanel);
        //file.add(next);

        file.addSeparator();

        exit = new JMenuItem("Выход");
        exit.setFont(new Font("Tahoma", Font.TRUETYPE_FONT, 11));
        exit.setName("Exit");
        exit.setMnemonic('E');
        //exit.addActionListener(tablePanel);

        file.add(exit);
        mbar.add(file);       

        JToolBar bar = new JToolBar("tools");
        bar.setFloatable(false);
        bar.setLayout(new GridBagLayout());
        JButton b1 = new JButton();
        b1.setIcon(new ImageIcon("play.png"));
        b1.setName("Run");
        b1.setToolTipText("Run");
        //b1.addActionListener(tablePanel);
        b1.setFocusable(false);
        bar.add(b1, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST,
            GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));       

        /*add(bar, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST,
            GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));*/

        add(infoPanel, new GridBagConstraints(0, 1, 1, 10, 1, 1, GridBagConstraints.NORTHWEST,
            GridBagConstraints.BOTH, new Insets(0, 5, 0, 5), 0, 0));      
    }
}
